#include "Bullet3Common/b3StackAlloc.h"
#ifdef __cplusplus
extern "C" {
#endif
b3StackAlloc* bullet_Newb3StackAlloc(unsigned int size){
	unsigned int c_arg_size=size;
	b3StackAlloc* wrap_out = new b3StackAlloc(c_arg_size);
	return wrap_out;
}

unsigned char* bullet_b3StackAlloc_allocate(b3StackAlloc* c_this,unsigned int size){
	unsigned int c_arg_size=size;
	unsigned char * c_out = c_this->allocate(c_arg_size);
	unsigned char* wrap_out = (unsigned char*)(void*)(c_out);
	return wrap_out;
}

b3Block* bullet_b3StackAlloc_beginBlock(b3StackAlloc* c_this){
	b3Block * c_out = c_this->beginBlock();
	b3Block* wrap_out = (b3Block*)(void*)(c_out);
	return wrap_out;
}

void bullet_b3StackAlloc_create(b3StackAlloc* c_this,unsigned int size){
	unsigned int c_arg_size=size;
	c_this->create(c_arg_size);
}

void bullet_b3StackAlloc_destroy(b3StackAlloc* c_this){
	c_this->destroy();
}

void bullet_b3StackAlloc_endBlock(b3StackAlloc* c_this,b3Block* block){
	b3Block * c_arg_block=(b3Block *)(void*)(block);
	c_this->endBlock(c_arg_block);
}

int bullet_b3StackAlloc_getAvailableMemory(b3StackAlloc* c_this){
	int c_out = c_this->getAvailableMemory();
	int wrap_out = (c_out);
	return wrap_out;
}

b3Block* bullet_Newb3Block(){
	b3Block* wrap_out = new b3Block();
	return wrap_out;
}

unsigned char** bullet_b3Block_GetFieldOfAddress(b3Block* c_this){
	return (unsigned char**)(&c_this->address);
}

b3Block** bullet_b3Block_GetFieldOfPrevious(b3Block* c_this){
	return (b3Block**)(&c_this->previous);
}

#ifdef __cplusplus
}
#endif
